	<?php
			session_start();
			
			require_once('../config.php');
			include_once("../database/DataBase.php");
			include_once("function.php");

			$pid = decrypt_string($_POST["key"]);
							
			$database = New DataBase();
			$database->open_connection();
			$result = $database->deleteDiscount($pid, $_SESSION["company_id"]);
			
			if(!is_null($result)){
				$database->LogAction($_SESSION["user_id"], "Deactive", "Deactive product : ".$pid." from ".getIpAddress());
				echo "True";
			}
			$database->close_connection();
	?>